<!DOCTYPE html>
<html>
<head>
    <title>绑定信息</title>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <link rel="stylesheet" href="${s.base}/mobile/css/weui.min.css">
    <link rel="stylesheet" href="${s.base}/mobile/css/jquery-weui.css">
    <link rel="stylesheet" href="${s.base}/mobile/css/base.css">
    <link rel="stylesheet" href="${s.base}/mobile/css/component.css">
</head>
<body>
<div class="xyg-comp-list-select">
    <div class="xyg-comp-list-select-item">
        <div class="xyg-comp-list-select-item-title">
            姓名
        </div>
        <div class="xyg-comp-list-select-item-content">
            <input type="text" id="name" value="${webMember.name}" maxlength="12" placeholder="请先填写姓名">
        </div>
    </div>
    <div class="xyg-comp-list-select-item">
        <div class="xyg-comp-list-select-item-title">
            手机号
        </div>
        <div class="xyg-comp-list-select-item-content">
            <input type="text"  id="phone" value="${webMember.phone}"  maxlength="12" placeholder="请先填写手机号">
        </div>
    </div>
    <div class="xyg-comp-list-select-item">
        <div class="xyg-comp-list-select-item-title">
            支付宝
        </div>
        <div class="xyg-comp-list-select-item-content">
            <input type="text"  id="alipay" value="${webMember.alipay}" maxlength="30" placeholder="请先填写支付宝">
        </div>
    </div>
    <div class="xyg-comp-list-select-item">
        <div class="xyg-comp-list-select-item-title">
            银行卡号
        </div>
        <div class="xyg-comp-list-select-item-content">
            <input type="text"  id="bankCard" value="${webMember.bankCard}" maxlength="30" placeholder="请先填写银行卡号">
        </div>
    </div>
</div>
<div class="xyg-bottom">
    <a href="javascript:bindUser();" class="xyg-btn" >立即绑定</a>
</div>
<style type="text/css">
    html,body{background:#f5f5f5;}
    .xyg-comp-list-select{width:96%; margin: 0.2rem 2%; border-radius: 0.5rem; height:auto;}
    .xyg-comp-list-select-desc{width:100%;text-align:center;line-height:2.2rem; height:2.2rem;font-size: 0.8rem; color:#ffffff; letter-spacing: 0.01rem; border-radius: 0.2rem 0.2rem 0px 0px; background: #069AFE;border-right: 0.001rem solid #f5f5f5;border-left: 0.001rem solid #f5f5f5;}
    .xyg-comp-list-select-item{width:90%; padding:0px 5%; line-height:2.2rem; height:2.2rem;font-size: 0.8rem; color:#333333; letter-spacing: 0.01rem; background: #FFF; border: 0.001rem solid #f5f5f5;}
    .xyg-comp-list-select-item input::-webkit-input-placeholder {color: #999999;}
    .xyg-comp-list-select-item .xyg-comp-list-select-item-title{width:25%; color:#333333; height:2rem; text-align:left; float:left;}
    .xyg-comp-list-select-item .xyg-comp-list-select-item-content{width:75%; height:2rem; text-align:left; float:left;}
    .xyg-comp-list-select-item .xyg-comp-list-select-item-content input[type='text']{width:100%; height:2rem; line-height:2rem;background-color:transparent;border:0; text-align:left;}

    .xyg-comp-list-select-textarea{width:90%;  color:#333333;padding:0px 5%;height:8.2rem;font-size: 0.8rem;  letter-spacing: 0.01rem; background: #FFF; border: 0.001rem solid #f5f5f5;}
    .xyg-comp-list-select-textarea .xyg-comp-list-select-textarea-title{width:100%; line-height: 2rem; height:2rem; text-align:left;}
    .xyg-comp-list-select-textarea .xyg-comp-list-select-textarea-content{width:100%; height:4rem; text-align:left; float:left;}
    .xyg-comp-list-select-textarea .xyg-comp-list-select-textarea-content textarea{width:92%; padding: 0.2rem 4%; height:4.6rem; margin-bottom: 1rem; line-height:1rem;background-color:#E5E5E5;;border:0; text-align:left;}

    .xyg-comp-xy{height:2rem; line-height:2rem;width:93%; margin:0px 2% 0px 5%;}
    .xyg-bottom{width:90%; height:auto;  margin:1.5rem 5%;}
    .xyg-bottom  .xyg-btn{
        position: relative;
        background: #069AFE;
        display: block;
        margin-left: auto;
        margin-right: auto;
        padding-left: 14px;
        padding-right: 14px;
        box-sizing: border-box;
        font-size: 18px;
        text-align: center;
        text-decoration: none;
        color: #fff;
        line-height: 2.55555556;
        border-radius: 5px;
        -webkit-tap-highlight-color: rgba(0,0,0,0);
        overflow: hidden;
    }}
</style>
</body>
<script src="${s.base}/mobile/js/jquery-2.1.4.js"></script>
<script src="${s.base}/mobile/js/jquery-weui.js"></script>
<script src="${s.base}/mobile/fonts/iconfont.js"></script>
<script>
    var type = '${type}';
    var memberId = '${memberId}';
    $(document).ready(function(){
        if(type=="2"){
            $.alert("请先绑定信息！");
        }
    });

    function bindUser() {
        var name = $("#name").val();
        if(name == null || name == ""){
            $.toast("请填写姓名", "text");
            return false;
        }

        var phone = $("#phone").val();
        if(phone == null || phone == ""){
            $.toast("请填写手机号", "text");
            return false;
        }
        var alipay = $("#alipay").val();
        if(alipay == null || alipay == ""){
            $.toast("请填写支付宝号", "text");
            return false;
        }
        var bankCard = $("#bankCard").val();
        if(bankCard == null || bankCard == ""){
            $.toast("请填写银行卡号", "text");
            return false;
        }



        $.showLoading("正在提交中");
        $.post("/phone/bindUserSave", {
            name: name,
            phone: phone,
            bankCard: bankCard,
            alipay: alipay,
            id: memberId
        }, function (result) {
            if(0==result.code){
                $.hideLoading();
                // 刷新当前页面
                $.alert("绑定成功！",function () {
                    window.location.href="/phone/my?memberId="+memberId;
                });

            }else{
                $.hideLoading();
                $.toast(result.msg, "text");
            }
        });
    }

</script>
</html>

